// 获得玩家出拳
var playerAction = process.argv[process.argv.length-1];
var method = ['rock','scissor','cloth'];
// 电脑随机出拳
var computerValue = Math.floor(Math.random()*3);
var random = method[computerValue];
// 获取玩家出拳的value值
var playerValue = method.indexOf(playerAction);
// 打印两者出拳
console.log('电脑：'+random);
console.log('玩家：'+playerAction);
// 比较
if(playerValue-computerValue===-1||playerValue-computerValue===2){
    console.log('玩家获胜！');
} else if(playerValue===computerValue){
    console.log('平局！');
} else{
    console.log('电脑获胜！');
}

